for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
/* eslint-disable no-new */
import chai, {expect} from 'chai';
import chaijQ from 'chai-jq';
// import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import fs from 'fs';
chai.use(chaijQ);
chai.use(sinonChai);
const template = fs.readFileSync('test/fixtures/template.html', 'utf-8');
function setBody(html) {
document.body.innerHTML = html;
}
function resetBody() {
document.body.innerHTML = '';
describe('jquery.nouislider-range-input', () => {
let $;
beforeEach(() => {
jest.resetModules();
jest
/** global: jest */
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.
$ = require('jquery');
require('../src');
});
afterEach(resetBody);
test('register as a function on the jQuery prototype', () => {
expect($.fn.enableNoUISlider).to.be.a('function');
test('enable nouislider on a range input', () => {
setBody(template);
$('.my-custom-class-enabling-nouislider').enableNoUISlider();
expect($('.my-custom-class-enabling-nouislider'))
.to.have.$class('js-nouislider-initialized');
expect(
$('.my-custom-class-enabling-nouislider')
.siblings('div.nouislider-range-wrapper')
.children('div').eq(0)
).to.have.$class('noUi-target');
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.